package com.yuchengtech.simpleServer.servlet;

import java.io.FileInputStream;
import com.yuchengtech.simpleServer.core.HttpRequest;
import com.yuchengtech.simpleServer.core.HttpResponse;
import com.yuchengtech.simpleServer.core.exception.SimpleServerException;

public class FileServlet extends SimpleServlet{
	
	FileInputStream stream=null;
	long length=0;
	
	public FileServlet(FileInputStream stream,long length) {
		this.stream=stream;
		this.length=length;
	}
	
	public void destory()  throws SimpleServerException{
		
	}

	public void init()  throws SimpleServerException{
		
	}

	
	public void service(HttpRequest request,HttpResponse response)  throws SimpleServerException{
		response.addResponse(stream, length);
	}
	

}
